<template>
<div class="wrap">
  <div id="container"></div>
  <div class="foot">本服务由咸宁市城市管理执法委员会提供</div>
</div>
</template>
<script src="https://prod-pass4.ehbapp.hubei.gov.cn:30443/static/jssdk/jssdk.js"></script>
<script src="http://zwfw.hubei.gov.cn/s/hbzwfw_jssdk/js/jssdk.js"></script>

<script>
export default {
    data(){
        return{
            address:'',
            longitude:'',
            latitude:''
        }
    },
    created(){
        // var map = new AMap.Map('container');
    },
    mounted(){
        console.log(1111111111,this.$route.query)
        const {address,longitude,latitude} = this.$route.query
        this.address = address
        this.longitude = longitude
        this.latitude = latitude
        console.log('获取到的地址和经纬度是：',this.address,this.longitude,this.latitude)

        this.amap()
    },
    methods:{
        amap(){
            
            let map = new AMap.Map('container', {
                zoom:14,//级别
                center: [this.longitude, this.latitude],//中心点坐标
                viewMode:'3D'//使用3D视图
            });
            let marker = new AMap.Marker({
                position:[this.longitude, this.latitude]//位置
            })
            map.add(marker);
        }
    }
}
</script>

<style lang='less'>
html,body{
    width: 100%;
    height: 100%;
}
#container {width:100%; height: 300px; }  
.foot{
    color: #999999;
    margin-top: 200px;
    text-align: center;
}
</style>